﻿
namespace KlearTweet.Client.Tab
{
    public partial class TabContainer
    {
        public TabContainer()
        {
            InitializeComponent();
        }

        public void AddTab(TabHeader header, TabContent content)
        {
            var panel = new System.Windows.Controls.Grid();
            panel.RowDefinitions.Add(new System.Windows.Controls.RowDefinition { Height = System.Windows.GridLength.Auto });
            panel.RowDefinitions.Add(new System.Windows.Controls.RowDefinition());

            panel.Children.Add(header);
            panel.Children.Add(content);
            System.Windows.Controls.Grid.SetRow(content, 1);

            TabHost.Children.Add(panel);
            TabHost.ColumnDefinitions.Add(new System.Windows.Controls.ColumnDefinition());
            System.Windows.Controls.Grid.SetColumn(panel, TabHost.ColumnDefinitions.Count-1);
        }
    }
}
